home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 563 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: oliva@grande.dcc.unicamp.br (Alexandre Oliva)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Calling X(int) from X()'s init list
  5. Date: 27 Feb 1996 10:39:38 PST
  6. Organization: DCC - UNICAMP - Campinas, SP, Brazil
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <orohqliepi.fsf@grande.dcc.unicamp.br>
  9. NNTP-Posting-Host: isolde.mti.sgi.com
  10. X-Original-Date: 27 Feb 1996 01:18:17 -0300
  11. X-Newsreader: Gnus v5.1
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBVAwUBMTNQD0y4NqrwXLNJAQHj3wIAiMYybNyUGG6xBTIBuQK9iERRAd7FdzSR
  14.     zvG+tgjlTRNCONssMYO3tf5N1XXvdiSaNVN2+g9sECLyfjpHg3Y97Q==
  15.     =XvBy
  16. Originator: austern@isolde.mti.sgi.com
  17.  
  18. Anders Lindback writes:
  19.  
  20. > David Byrden  <100101.2547@compuserve.com> wrote:
  21.  
  22. >> Why is it not allowed to delegate the initialisation to another
  23. >> constructor?
  24.  
  25. > Well, one could use a similar thing using a member function:
  26.  
  27. > X (int i) { init(i); }
  28. > X () { init(34); }
  29.  
  30. > where init is a member function for class X.
  31.  
  32. Not if you  have to initialize base  classes or references,  or member
  33. objects without default constructors.
  34. -- 
  35. Alexandre Oliva
  36. oliva@dcc.unicamp.br
  37. Universidade Estadual de Campinas, S~ao Paulo, Brasil
  38. ---
  39. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  40.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  41.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  42.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  43.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  44. ]
  45.